import { TokenRequestData } from '@/types'
import { FeatureCollection, MultiPolygon, Feature } from 'geojson'

export interface getMapJsonRequestData {
  adcode: string
}

export interface getMapJsonResponseData extends FeatureCollection<MultiPolygon> {
  features: Array<Feature<MultiPolygon, propertiesEntity>>
}

export interface ParentAdcode {
  adcode: number
}

export interface propertiesEntity {
  acroutes: [number, number]
  adcode: number
  center: [number, number]
  centroid: [number, number]
  childrenNum: number
  level: string
  name: string
  parent: ParentAdcode
  subFeatureIndex: number
}

export interface queryBatteryTotalDetectionRequestData extends TokenRequestData {
  type: string
}

export type queryBatteryTotalDetectionResponse = ApiResponseData<any>

export interface queryMapRequestData extends TokenRequestData {
  produceId: string
}

export type queryMapResponse = ApiResponseData<getMapJsonResponseData>
